<!DOCTYPE html>
<html>

	<head>
	<meta charset="utf-8" />
	<title>选择分类</title>
	<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
	<link rel="stylesheet" href="__AGENT__/css/css.css" />
	<style type="text/css">
		.payment_erweima canvas{width: 200px; height: 200px;}
		body {overflow:scroll; overflow-y:hidden;} 
		.fkselbox{background: white; margin-bottom: 10px; border: 1px solid #DDDDDD;}
		.my_sel{background: none; height: 40px; line-height: 40px; font-weight: bold; color: #79A42A; font-size: 20px; width: 100%;}
		.my_sel option{font-size: 16px;}
	</style>
</head>

<body>		
	<div class="fkselbox" style="text-align: center;">
		<select lay-ignore id="chain_se" class="my_sel" style="width: 60%;">
			<option value="0">选择分类</option>
			{foreach name="chains" item="chain"}
			<option value="{$chain.id}">{$chain.type_name}</option>
			{/foreach}
		</select>
	</div>
	<div class="payment_butbox" >
		<button type="button" onclick="change_code()" class="payment_but" style="padding: 5px;background: #63b43b;    padding-bottom: 10px;">保存</button>
	</div>
	
</body>

</html>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	function change_code(){
		var sort_id = $('#chain_se').val();
		var id_list = "{$id_list}";
		$.ajax({
				type:"post",
				url: "{:url('shop/select_sort')}",
				data: {
					id_list		:id_list,
					sort_id		:sort_id
				},
				success: function(data) {
					layer.msg(data.msg, {
						icon: 1,
						time: 1000
					}, function() {
						window.parent.location.reload();
					});
				}
			})
	}
   
</script>